<!DOCTYPE HTML>
<html>

<head>
	<link rel="bookmark"  type="image/x-icon"  href="/img/logo_miccall.png"/>
	<link rel="shortcut icon" href="/img/logo_miccall.png">
	
			    <title>
    Ame雨
    </title>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
    <link rel="stylesheet" href="/amelin-ting/css/mic_main.css" />
    <link rel="stylesheet" href="/amelin-ting/css/dropdownMenu.css" />
    <meta name="keywords" content="Ame雨" />
    
    	<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
	 
    <noscript>
        <link rel="stylesheet" href="/amelin-ting/css/noscript.css" />
    </noscript>
    <style type="text/css">
        body:before {
          content: ' ';
          position: fixed;
          top: 0;
          background: url('/amelin-ting/img/bg.jpg') center 0 no-repeat;
          right: 0;
          bottom: 0;
          left: 0;
          background-size: cover; 
        }
    </style>

			    
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script async type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


    <script src="/amelin-ting/js/jquery.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrollex.min.js"></script>
    <script src="/amelin-ting/js/jquery.scrolly.min.js"></script>
    <script src="/amelin-ting/js/skel.min.js"></script>
    <script src="/amelin-ting/js/util.js"></script>
    <script src="/amelin-ting/js/main.js"></script>
	
<meta name="generator" content="Hexo 5.4.0"></head>
    
		
<!-- Layouts -->



<!--  代码渲染  -->
<link rel="stylesheet" href="/css/prism_coy.css" />
<link rel="stylesheet" href="/css/typo.css" />
<!-- 文章页 -->
<body class="is-loading">
    <!-- Wrapper 外包 s-->
    <div id="wrapper" class="fade-in">
        <!-- Intro 头部显示 s -->
        <!-- Intro 头部显示 e -->
        <!-- Header 头部logo start -->
        <header id="header">
    <a href="/amelin-ting/" class="logo">Art Space</a>
</header>
        <!-- Nav 导航条 start -->
        <nav id="nav" class="special" >
            <ul class="menu links" >
			<!-- Homepage  主页  --> 
			<li >
	            <a href="/amelin-ting/" rel="nofollow">主页</a>
	        </li>
			<!-- categories_name  分类   --> 
	        
	        <li class="active">
	            <a href="#s1">分类</a>
	                    <ul class="submenu">
	                        <li>
	                        <a class="category-link" href="/amelin-ting/categories/Go/">Go</a></li><li><a class="category-link" href="/amelin-ting/categories/django/">django</a></li><li><a class="category-link" href="/amelin-ting/categories/drf/">drf</a></li><li><a class="category-link" href="/amelin-ting/categories/gin/">gin</a></li><li><a class="category-link" href="/amelin-ting/categories/go/">go</a></li><li><a class="category-link" href="/amelin-ting/categories/linux/">linux</a></li><li><a class="category-link" href="/amelin-ting/categories/mysql/">mysql</a></li><li><a class="category-link" href="/amelin-ting/categories/python/">python</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%86%85%E7%BD%91%E7%A9%BF%E9%80%8F/">内网穿透</a></li><li><a class="category-link" href="/amelin-ting/categories/%E5%89%8D%E7%AB%AF/">前端</a>
	                    </ul>
	        </li>
	        
	        <!-- archives  归档   --> 
	        
	        
		        <!-- Pages 自定义   -->
		        
		        <li>
		            <a href="/about/" title="简历">
		                简历
		            </a>
		        </li>
		        
		        <li>
		            <a href="/group/" title="团队">
		                团队
		            </a>
		        </li>
		        
		        <li>
		            <a href="/gallery/" title="图库">
		                图库
		            </a>
		        </li>
		        
		        <li>
		            <a href="/tag/" title="标签">
		                标签
		            </a>
		        </li>
		        


            </ul>
            <!-- icons 图标   -->
			<ul class="icons">
                    
                    <li>
                        <a title="github" href="https://github.com/miccall" target="_blank" rel="noopener">
                            <i class="icon fa fa-github"></i>
                        </a>
                    </li>
                    
                    <li>
                        <a title="500px" href="http://500px.com" target="_blank" rel="noopener">
                            <i class="icon fa fa-500px"></i>
                        </a>
                    </li>
                    
			</ul>
</nav>

        <div id="main" >
            <div class ="post_page_title_img" style="height: 25rem;background-image: url(https://img2.baidu.com/it/u=1918731617,3579143187&amp;fm=26&amp;fmt=auto);background-position: center; background-repeat:no-repeat; background-size:cover;-moz-background-size:cover;overflow:hidden;" >
                <a href="#" style="padding: 4rem 4rem 2rem 4rem ;"><h2 >drfJWT</h2></a>
            </div>
            <!-- Post -->
            <div class="typo" style="padding: 3rem;">
                <h2 id="一、JWT介绍"><a href="#一、JWT介绍" class="headerlink" title="一、JWT介绍"></a>一、JWT介绍</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1.</span> JWT (Json Web Token)</span><br><span class="line">      <span class="comment"># 在用户登录后，我们想记录用户的登录状态，或者为用户创建身份认证的凭证，我们不再使用Session认证机制，而是用JWT(本质就是Token)认证机制。	</span></span><br></pre></td></tr></table></figure>

<h2 id="二、-JWT快速使用"><a href="#二、-JWT快速使用" class="headerlink" title="二、 JWT快速使用"></a>二、 JWT快速使用</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 使用第三方模块：django-rest-framework-jwt（作者好多年不改了）</span></span><br><span class="line"><span class="comment"># 新的，用起来，跟它差不多（名字忘了）</span></span><br><span class="line"><span class="comment"># 安装：pip install djangorestframework-jwt</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># base64的使用（转码方式）</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 快速使用，签发token给前端</span></span><br><span class="line">	-用户表使用auth的user表</span><br><span class="line">    -登录功能不用写，djangorestframework-jwt帮你写好了</span><br></pre></td></tr></table></figure>



<h2 id="三、JWT内置认证类使用"><a href="#三、JWT内置认证类使用" class="headerlink" title="三、JWT内置认证类使用"></a>三、JWT内置认证类使用</h2><h3 id="3-1-签发（使用内置的）"><a href="#3-1-签发（使用内置的）" class="headerlink" title="3.1 签发（使用内置的）"></a>3.1 签发（使用内置的）</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 在路由中配置</span></span><br><span class="line">    <span class="keyword">from</span> rest_framework_jwt.views <span class="keyword">import</span> obtain_jwt_token</span><br><span class="line">    urlpatterns = [</span><br><span class="line">        path(<span class="string">&#x27;login/&#x27;</span>, obtain_jwt_token),  <span class="comment"># 登录接口好了，可以签发token，依赖了auth的user表</span></span><br><span class="line">    ]</span><br></pre></td></tr></table></figure>

<h3 id="3-2-认证"><a href="#3-2-认证" class="headerlink" title="3.2 认证"></a>3.2 认证</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> rest_framework_jwt.authentication <span class="keyword">import</span> JSONWebTokenAuthentication  <span class="comment"># drf_jwt内置的认证类</span></span><br><span class="line"><span class="keyword">from</span> rest_framework.permissions <span class="keyword">import</span> IsAuthenticated </span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">BookView</span>(<span class="params">APIView</span>):</span></span><br><span class="line">    <span class="comment"># 使用drf_jwt内置的认证，必须加这两个</span></span><br><span class="line">    authentication_classes = [JSONWebTokenAuthentication, ]</span><br><span class="line">    permission_classes = [IsAuthenticated]</span><br></pre></td></tr></table></figure>

<h2 id="四、自定义User表实现jwt的token签发"><a href="#四、自定义User表实现jwt的token签发" class="headerlink" title="四、自定义User表实现jwt的token签发"></a>四、自定义User表实现jwt的token签发</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> rest_framework.response <span class="keyword">import</span> Response</span><br><span class="line"><span class="keyword">from</span> .models <span class="keyword">import</span> UserInfo</span><br><span class="line"><span class="keyword">from</span> rest_framework_jwt.settings <span class="keyword">import</span> api_settings</span><br><span class="line"></span><br><span class="line">jwt_payload_handler = api_settings.JWT_PAYLOAD_HANDLER</span><br><span class="line">jwt_encode_handler = api_settings.JWT_ENCODE_HANDLER</span><br><span class="line"></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">LoginView</span>(<span class="params">APIView</span>):</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">post</span>(<span class="params">self, request</span>):</span></span><br><span class="line">        username = request.data.get(<span class="string">&#x27;username&#x27;</span>)</span><br><span class="line">        password = request.data.get(<span class="string">&#x27;password&#x27;</span>)</span><br><span class="line">        user = UserInfo.objects.<span class="built_in">filter</span>(username=username, password=password).first()</span><br><span class="line">        <span class="keyword">if</span> user: <span class="comment"># 用户名和密码正确，登陆成功，签发token</span></span><br><span class="line">            payload = jwt_payload_handler(user)</span><br><span class="line">            token = jwt_encode_handler(payload)</span><br><span class="line">            <span class="keyword">return</span> Response(&#123;&#123;<span class="string">&#x27;code&#x27;</span>: <span class="string">&#x27;100&#x27;</span>, <span class="string">&#x27;msg&#x27;</span>: <span class="string">&#x27;登录成功&#x27;</span>, <span class="string">&#x27;token&#x27;</span>: token, <span class="string">&#x27;usrename&#x27;</span>: user.username&#125;&#125;)</span><br><span class="line">        <span class="keyword">else</span>:</span><br><span class="line">            <span class="keyword">return</span> Response(&#123;<span class="string">&#x27;code&#x27;</span>: <span class="string">&#x27;101&#x27;</span>, <span class="string">&#x27;msg&#x27;</span>: <span class="string">&#x27;用户名或密码错误&#x27;</span>&#125;)</span><br><span class="line">            </span><br></pre></td></tr></table></figure>

<h2 id="五、自定义认证类，实现jwt的token认证"><a href="#五、自定义认证类，实现jwt的token认证" class="headerlink" title="五、自定义认证类，实现jwt的token认证"></a>五、自定义认证类，实现jwt的token认证</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">from</span> rest_framework.authentication <span class="keyword">import</span> BaseAuthentication</span><br><span class="line"><span class="keyword">from</span> rest_framework <span class="keyword">import</span> exceptions</span><br><span class="line"><span class="keyword">import</span> jwt</span><br><span class="line"><span class="keyword">from</span> .models <span class="keyword">import</span> UserInfo</span><br><span class="line"><span class="keyword">from</span> rest_framework_jwt.settings <span class="keyword">import</span> api_settings</span><br><span class="line">jwt_decode_handler = api_settings.JWT_DECODE_HANDLER</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">JwtAuthentication</span>(<span class="params">BaseAuthentication</span>):</span></span><br><span class="line">    <span class="function"><span class="keyword">def</span> <span class="title">authenticate</span>(<span class="params">self, request</span>):</span></span><br><span class="line">        <span class="comment"># 取出前端传入的token串</span></span><br><span class="line">        token=request.META.get(<span class="string">&#x27;HTTP_TOKEN&#x27;</span>)</span><br><span class="line">        <span class="comment"># 通过token获得payload</span></span><br><span class="line">        <span class="keyword">try</span>:</span><br><span class="line">            payload = jwt_decode_handler(token) <span class="comment"># 通过token串获得payload，验签（是否被篡改），检查过期时间</span></span><br><span class="line">        <span class="comment"># except Exception:</span></span><br><span class="line">        <span class="comment">#     raise exceptions.AuthenticationFailed(&#x27;token认证失败&#x27;)</span></span><br><span class="line">        <span class="keyword">except</span> jwt.ExpiredSignature:</span><br><span class="line">            msg = <span class="string">&#x27;签名过期&#x27;</span></span><br><span class="line">            <span class="keyword">raise</span> exceptions.AuthenticationFailed(msg)</span><br><span class="line">        <span class="keyword">except</span> jwt.DecodeError:</span><br><span class="line">            msg =<span class="string">&#x27;解码错误&#x27;</span></span><br><span class="line">            <span class="keyword">raise</span> exceptions.AuthenticationFailed(msg)</span><br><span class="line">        <span class="keyword">except</span> jwt.InvalidTokenError:</span><br><span class="line">            <span class="keyword">raise</span> exceptions.AuthenticationFailed()</span><br><span class="line">        <span class="comment"># 通过payload获得当前用户（自己的表，自己拿）</span></span><br><span class="line">        <span class="comment"># user=UserInfo.objects.filter(pk=payload[&#x27;user_id&#x27;]).first()</span></span><br><span class="line">        </span><br><span class="line">        </span><br><span class="line">        <span class="comment"># 稍微优化一下，不是每次都取查询当前登录用户</span></span><br><span class="line">        <span class="comment"># user=&#123;&#x27;id&#x27;:payload[&#x27;user_id&#x27;],&#x27;username&#x27;:payload[&#x27;username&#x27;]&#125;</span></span><br><span class="line">        user=UserInfo(<span class="built_in">id</span>=payload[<span class="string">&#x27;user_id&#x27;</span>],username=payload[<span class="string">&#x27;username&#x27;</span>])</span><br><span class="line">        <span class="comment"># 返回当前用户</span></span><br><span class="line">        <span class="keyword">return</span> user,token</span><br></pre></td></tr></table></figure>

<h2 id="六、RBAC介绍"><a href="#六、RBAC介绍" class="headerlink" title="六、RBAC介绍"></a>六、RBAC介绍</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># 基于角色的访问控制：RBAC  是基于角色的访问控制（Role-Based Access Control ）在 RBAC  中，权限与角色相关联，用户通过成为适当角色的成员而得到这些角色的权限。这就极大地简化了权限的管理。这样管理都是层级相互依赖的，权限赋予给角色，而把角色又赋予用户，这样的权限设计很清楚，管理起来很方便。</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># rbac权限控制一般都是用在公司内部的管理系统中（python的django写公司内部项目较多，rbac很重要）</span></span><br><span class="line"><span class="comment"># Django的 Auth组件 采用的认证规则就是RBAC</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># rbac表分析</span></span><br><span class="line">	-用户表：auth_user</span><br><span class="line">    -角色表（部门，组表）：auth_group</span><br><span class="line">    -权限表：auth_permission</span><br><span class="line">    </span><br><span class="line">    -角色和权限是多对多---》中间表：auth_group_permissions</span><br><span class="line">    -用户和角色是多对多---》中间表：auth_user_groups</span><br><span class="line">    </span><br><span class="line">    -django的auth多写了一个表，用户和权限的多对多：auth_user_user_permissions</span><br><span class="line">    </span><br><span class="line"><span class="comment"># djago有个admin后台管理，配合auth，可以快速搭建出一个基于rbac的后台管理系统   </span></span><br><span class="line"></span><br><span class="line"><span class="comment"># 几年前，好多公司内部的管理系统，就是使用django的admin快速搭建的</span></span><br><span class="line"><span class="comment"># admin不好看，第三方美化</span></span><br><span class="line">	-django <span class="number">1.</span>x上很火的 Xadmin：前端基于jq+bootstrap，<span class="number">2.</span>x上支持不好了，<span class="number">3.</span>x直接不能用了，而且作者也弃坑了，他又做了一个前后端分离的admin</span><br><span class="line">    -simple-ui：djanog <span class="number">3.</span>x</span><br></pre></td></tr></table></figure>

<h2 id="七、simple-ui的使用（对admin美化）"><a href="#七、simple-ui的使用（对admin美化）" class="headerlink" title="七、simple-ui的使用（对admin美化）"></a>七、simple-ui的使用（对admin美化）</h2><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br></pre></td><td class="code"><pre><span class="line"><span class="number">1</span> pip3 install django-simpleui</span><br><span class="line"><span class="number">2</span> 自定义左侧导航栏</span><br><span class="line">	<span class="keyword">import</span> time</span><br><span class="line">SIMPLEUI_CONFIG = &#123;</span><br><span class="line">    <span class="string">&#x27;system_keep&#x27;</span>: <span class="literal">False</span>,</span><br><span class="line">    <span class="string">&#x27;menu_display&#x27;</span>: [<span class="string">&#x27;Simpleui&#x27;</span>,<span class="string">&#x27;权限认证&#x27;</span>, <span class="string">&#x27;多级菜单测试&#x27;</span>,<span class="string">&#x27;动态菜单测试&#x27;</span>],      <span class="comment"># 开启排序和过滤功能, 不填此字段为默认排序和全部显示, 空列表[] 为全部不显示.</span></span><br><span class="line">    <span class="string">&#x27;dynamic&#x27;</span>: <span class="literal">True</span>,    <span class="comment"># 设置是否开启动态菜单, 默认为False. 如果开启, 则会在每次用户登陆时动态展示菜单内容</span></span><br><span class="line">    <span class="string">&#x27;menus&#x27;</span>: [</span><br><span class="line">        &#123;</span><br><span class="line">        <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;Simpleui&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fas fa-code&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;/home/&#x27;</span> <span class="comment"># 自己的地址（前后端混合项目）</span></span><br><span class="line">    &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">        <span class="string">&#x27;app&#x27;</span>: <span class="string">&#x27;auth&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;权限认证&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fas fa-user-shield&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;models&#x27;</span>: [&#123;</span><br><span class="line">            <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;用户&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fa fa-user&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;auth/user/&#x27;</span></span><br><span class="line">        &#125;]</span><br><span class="line">    &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">        <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;多级菜单测试&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fa fa-file&#x27;</span>,</span><br><span class="line">      	<span class="comment"># 二级菜单</span></span><br><span class="line">        <span class="string">&#x27;models&#x27;</span>: [</span><br><span class="line">            &#123;</span><br><span class="line">            <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;Baidu&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;far fa-surprise&#x27;</span>,</span><br><span class="line">            <span class="comment"># 第三级菜单 ，</span></span><br><span class="line">            <span class="string">&#x27;models&#x27;</span>: [</span><br><span class="line">                &#123;</span><br><span class="line">                  <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;爱奇艺&#x27;</span>,</span><br><span class="line">                  <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;https://www.iqiyi.com/dianshiju/&#x27;</span></span><br><span class="line">                  <span class="comment"># 第四级就不支持了，element只支持了3级</span></span><br><span class="line">                &#125;, &#123;</span><br><span class="line">                    <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;百度问答&#x27;</span>,</span><br><span class="line">                    <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;far fa-surprise&#x27;</span>,</span><br><span class="line">                    <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;https://zhidao.baidu.com/&#x27;</span></span><br><span class="line">                &#125;</span><br><span class="line">            ]</span><br><span class="line">        &#125;,</span><br><span class="line">            &#123;</span><br><span class="line">            <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;内网穿透&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;https://www.wezoz.com&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fab fa-github&#x27;</span></span><br><span class="line">        &#125;]</span><br><span class="line">    &#125;,</span><br><span class="line">        &#123;</span><br><span class="line">        <span class="string">&#x27;name&#x27;</span>: <span class="string">&#x27;动态菜单测试&#x27;</span> ,</span><br><span class="line">        <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;fa fa-desktop&#x27;</span>,</span><br><span class="line">        <span class="string">&#x27;models&#x27;</span>: [&#123;</span><br><span class="line">            <span class="string">&#x27;name&#x27;</span>: time.time(),</span><br><span class="line">            <span class="string">&#x27;url&#x27;</span>: <span class="string">&#x27;http://baidu.com&#x27;</span>,</span><br><span class="line">            <span class="string">&#x27;icon&#x27;</span>: <span class="string">&#x27;far fa-surprise&#x27;</span></span><br><span class="line">        &#125;]</span><br><span class="line">    &#125;]</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment">## 智慧大屏</span></span><br><span class="line">https://gitee.com/kevin_chou/dataVIS</span><br></pre></td></tr></table></figure>


            </div>

            <!-- Post Comments -->
            
    <!-- 使用 DISQUS_CLICK -->
<div id="disqus-comment">
    <div id="disqus_thread"></div>

<!-- add animation -->
<style>
	.disqus_click_btn {
            line-height: 30px;
            margin: 0;
            min-width: 50px;
            padding: 0 14px;
            display: inline-block;
            font-family: "Roboto", "Helvetica", "Arial", sans-serif;
            font-size: 14px;
            font-weight: 400;
            text-transform: uppercase;
            letter-spacing: 0;
            overflow: hidden;
            will-change: box-shadow;
            transition: box-shadow .2s cubic-bezier(.4, 0, 1, 1), background-color .2s cubic-bezier(.4, 0, .2, 1), color .2s cubic-bezier(.4, 0, .2, 1);
            outline: 0;
            cursor: pointer;
            text-decoration: none;
            text-align: center;
            vertical-align: middle;
            border: 0;
            background: rgba(158, 158, 158, .2);
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12);
            color: #fff;
            background-color: #7EC0EE;
            text-shadow: 0
        }
</style>
	
<div class="btn_click_load" id="disqus_bt"> 
    <button class="disqus_click_btn">点击查看评论</button>
</div>

<!--
<script type="text/javascript">
$('.btn_click_load').click(function() {
    /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
    var disqus_shortname = 'http-miccall-tech'; // required: replace example with your forum shortname

    /* * * DON'T EDIT BELOW THIS LINE * * */
    (function() {
      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
      dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
    })();

    document.getElementById('disqus_bt').style.display = "none";
});
</script>
-->
<script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'https://gitee.com/AmeX/amelin-ting.git/2018/05/28/drf------JWT/';  // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = 'https://gitee.com/AmeX/amelin-ting.git/2018/05/28/drf------JWT/'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
    };
</script>

<script type="text/javascript">
    $('.btn_click_load').click(function() {  //click to load comments
        (function() { // DON'T EDIT BELOW THIS LINE
            var d = document;
            var s = d.createElement('script');
            s.src = '//http-miccall-tech.disqus.com/embed.js';
            s.setAttribute('data-timestamp', + new Date());
            (d.head || d.body).appendChild(s);
        })();
        $('.btn_click_load').css('display','none');
    });
</script>
</div>
<style>
    #disqus-comment{
        background-color: #eee;
        padding: 2pc;
    }
</style>


        </div>
        <!-- Copyright 版权 start -->
                <div id="copyright">
            <ul>
                <li>&copy;Powered By <a target="_blank" rel="noopener" href="https://hexo.io/zh-cn/" style="border-bottom: none;">hexo</a></li>
                <li>Design: <a target="_blank" rel="noopener" href="http://miccall.tech " style="border-bottom: none;">miccall</a></li>
            </ul>
            
                <span id="busuanzi_container_site_pv">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
			
        </div>
    </div>
</body>



 	
</html>
